package my.app.taxi;

import java.util.ArrayList;
import java.util.List;

import my.app.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

public class TaxiRowAdapter extends ArrayAdapter<TaxiRowView>{

	ArrayList<TaxiRowView> items = null;
	
	public TaxiRowAdapter(Context context, int textViewResourceId, ArrayList<TaxiRowView> items) {
		super(context, textViewResourceId, items);
		this.items = items;
		// TODO Auto-generated constructor stub
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.taxi_list_row, null);
        }
        TaxiRowView t = items.get(position);
        return t;
	}

}
